#include<unistd.h>
#include<stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include<string.h>


int main()
{
  int fd=open("open.txt",O_WRONLY | O_CREAT ,0);
  if(fd == -1)
  {
    perror("open file falied\n");
    return -1;
  }

  const char str[]="这是一段用于检测open函数参数的示例\n";
  write(fd,str,sizeof(str));
  return 0;
}
